<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%-- <%@ include file="/WEB-INF/view/common/kendocommon.jsp"%> --%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<%@ include file="/WEB-INF/view/common/head.jsp"%>
    <script src="${basepath}/assets/jqueryupload/js/vendor/jquery.ui.widget.js"></script>
    <script src="${basepath}/assets/jqueryupload/js/jquery.iframe-transport.js"></script>
    <script src="${basepath}/assets/jqueryupload/js/jquery.fileupload.js"></script>
    <script src="${basepath}/assets/jqueryupload/js/jquery.fileupload-process.js"></script>
    <link rel="stylesheet" href="${basepath}/assets/jqueryupload/css/jquery.fileupload.css">
    <link rel="stylesheet" href="${basepath}/assets/xenon/css/bootstrap.css">
	<script type="text/javascript" src="${basepath}/assets/layer/layer.js"></script>
	<script type="text/javascript" src="${basepath}/assets/laydate/laydate.js"></script>
	<script type="text/javascript" src="${basepath}/assets/raty/lib/jquery.raty.min.js"></script>
	<script type="text/javascript" src="${basepath}/assets/my97/WdatePicker.js"></script>
	
	<link rel="stylesheet" href="${basepath}/assets/kindedit/themes/default/default.css" />  
    <script charset="utf-8" src="${basepath}/assets/kindedit/kindeditor-all-min.js"></script>  
    <script charset="utf-8" src="${basepath}/assets/kindedit/lang/zh_CN.js"></script>

<!--     <script type="text/javascript" src="localhost:8080/SperaOther/js/jquery-3.0.0.min.js"></script> -->
    <title>批量上传用户</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	    <style>
    	body {
			padding: 0;
			font-size: 12px;
		}
		h1 {
		    font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
		    padding: 0px 0px 10px 10px;
		    display: block;
		    border-bottom: 1px solid #DADADA;
		    margin: 10px 10px 10px 10px;
		    color: #888;
		    text-align: center;
		}
    </style>
  </head>
  <script>
 // var formData = new FormData($( "#userForm" )[0]);  
/*  var submitForm=function(){
 	$.ajax({  
     url : "${ path }/assist/addUsersSubmit",  
     type : "POST",  
     data : formData,  
     contentType: false, 
     success : function(data) {    	   	     	 
     	 if(data.status=='1'){
    	 		alert(data.msg);
    	 	}else{
    	 		alert(data.msg);
    	 	}         
     },  
     error : function(data) {  
          alert('出错啦'); 
     }  
	}); 
 */
 	
	/*
 	 var oData = new FormData(document.forms.namedItem("userForm" ));  
	 oData.append( "CustomField", "This is some extra data" );  
	 var oReq = new XMLHttpRequest();  
	 oReq.open( "POST", "${ path }/assist/addUsersSubmit" , true );  
	 oReq.onload = function(oEvent) { 
		 
	 console.log(oEvent);

	 };  
	 oReq.send(oData);   
} */
 
 $( function(){
		$('#fileupload').fileupload({
	        url: "${path}/assist/addUsersSubmit",
	        autoUpload: true,
	        //dataType: 'json',
	        done: function (e, data) {
	        	
	        	 if(data.result.status=='1'){
	     	 		alert(data.result.msg);
	     	 	}else{
	     	 		alert(data.result.msg);
	     	 	}    
	        	
/* 	        	if(data.result.status==0){
	        		layer.msg(data.result.msg, {time: 3000, icon:6});
	        	}else{
	        		alert('成功');
	        		//$('#image').attr('src',data.result.image_src)
	        		//$('#image_src').val(data.result.image_src)
	        	} */
	        },
	        progressall: function (e, data) {
	            var progress = parseInt(data.loaded / data.total * 100, 10);
	            $('#progress .progress-bar').css(
	                'width',
	                progress + '%'
	            );
	        }
	    }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
	
		$.fn.raty.defaults.path = '${basepath}/assets/raty/lib/img';
	      $('#precision-demo').raty({
    	  	path      : '${basepath}/assets/raty/lib/img',
          	cancelOff : 'cancel-off-big.png',
          	cancelOn  : 'cancel-on-big.png',
          	size      : 24,
          	starHalf  : 'star-half-big.png',
          	starOff   : 'star-off-big.png',
          	starOn    : 'star-on-big.png',
	        target    : '#t_score',
	        cancel    : true,
	        targetKeep: true,
	        precision : true
	      });   
	      
 })
 
 	var editor;  
    KindEditor.ready(function(K) {  
        editor = K.create('textarea[name="teach_glimpse"]', {  
        	items: ["source", "|", "undo", "redo", "|", "preview", "template", "code", "cut", "copy", "paste", "plainpaste", "wordpaste", "|", "justifyleft", 
        	        "justifycenter", "justifyright", "justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript", "superscript", 
        	        "clearhtml", "quickformat", "selectall", "|", "fullscreen", "/", "formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", 
        	        "bold", "italic", "underline", "strikethrough", "lineheight", "removeformat", "|", "image", "multiimage", "insertfile", "table", 
        	        "hr", "emoticons", "baidumap", "pagebreak"],
        	allowFileManager : true,
            allowImageUpload : true, 
        	uploadJson  : '${basepath}/assets/kindedit/jsp/upload_kind.jsp'
        });  
    });  
</script>
  <body>
	<form id="userForm" name="userForm" action="${path}/assist/addUsersSubmit" method="post" enctype="multipart/form-data">		
		<div style="display:inline-block;width:200px;padding-top:30px;padding-left:20px">
			<input id="fileupload" type="file" name="users" class="form-control"/>
			<div id="progress" class="progress">
				<div class="progress-bar progress-bar-success" class="form-control"></div>
			</div>
		</div>
<!-- 		<div style="display:inline-block;width:60%;padding-right:30px;padding-top:30px;float:left">
			<input type="submit" value="提交" /> 
			<input type="button" value="提交" onclick="submitForm()"/> 
		</div> -->
	</form>
</body>
</html>
